package com.example.openfeignconsumer.controller;

import com.example.openfeignconsumer.feignclient.SpringCloudNacosProviderClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class ConsumerController {
    @Resource
    private SpringCloudNacosProviderClient providerClient; // 加载 openfeign client

    @GetMapping("/consumer")
    public String consumer(@RequestParam String name) {
        // 调用 openfeign client 中的方法
        return providerClient.call(name);
    }
}
